diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-17 19:21:11 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-17 19:21:11 +0100 |
| commit | 37bc9d25deecb04b7970881d46551d5b33fe88df (patch) | |
| tree | 44e03f3ab883164c3916a606521b07461c05e40d /src/pages/article/[slug].tsx | |
| parent | cf195f8c6b4195423dd257a99afb904673d87d25 (diff) | |
chore: add meta to single posts
Diffstat (limited to 'src/pages/article/[slug].tsx')
| -rw-r--r-- | src/pages/article/[slug].tsx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index b3ab2ed..57982e9 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -1,5 +1,7 @@ import CommentsList from '@components/CommentsList/CommentsList'; import Layout from '@components/Layouts/Layout'; +import PostFooter from '@components/PostFooter/PostFooter'; +import PostHeader from '@components/PostHeader/PostHeader'; import { t } from '@lingui/macro'; import { fetchAllPostsSlug } from '@services/graphql/blog'; import { getPostBySlug } from '@services/graphql/post'; @@ -11,16 +13,23 @@ import { ParsedUrlQuery } from 'querystring'; import { ReactElement } from 'react'; const SingleArticle: NextPageWithLayout<ArticleProps> = ({ post }) => { + const { author, comments, content, date, intro, subjects, thematics, title } = + post; + return ( <article> - <header> - <h1>{post.title}</h1> - <div dangerouslySetInnerHTML={{ __html: post.intro }}></div> - </header> - <div dangerouslySetInnerHTML={{ __html: post.content }}></div> + <PostHeader + author={author} + date={date} + intro={intro} + title={title} + thematics={thematics} + /> + <div dangerouslySetInnerHTML={{ __html: content }}></div> + <PostFooter subjects={subjects} /> <section> <h2>{t`Comments`}</h2> - <CommentsList comments={post.comments} /> + <CommentsList comments={comments} /> </section> </article> ); |
